package siac.com.dao;

import java.util.List;

import org.hibernate.Query;
import org.hibernate.Session;

import siac.com.configuracao.ConexaoHibernate;
import siac.com.entity.AuthMenu;


public class AuthMenuDao extends AbstractHibernateDao<AuthMenu> {
	
	public AuthMenuDao() {
		super(AuthMenu.class);
	}

	@Override
	protected Session getSession() {
		return ConexaoHibernate.getSessionFactory().getCurrentSession();
	}

	public List<AuthMenu>findByOperacao(Object idOperacao) {
		Query query = this.getSession().getNamedQuery("AuthMenu.findByOperacao");
		query.setParameter("idOperacao", idOperacao);
		return query.list();
	}

	public List<AuthMenu>findByOperacaoRef(Object idOperacao) {
		Query query = this.getSession().getNamedQuery("AuthMenu.findByOperacaoRef");
		query.setParameter("menu", idOperacao);
		return query.list();
	}

	public List<AuthMenu> findStatus(Object status) {
		Query query = this.getSession().getNamedQuery("AuthMenu.findByStatus");
		query.setParameter("status", status);
		return query.list();
	}
}
